<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>动态添加和删除节点</title>
		<style type="text/css">
			.myArea{ width: 100%; height: 80px;}
			.myDiv{ line-height: 30px;}
		</style>
		<script type="text/javascript">
			window.onload=function(){
				var allA = document.getElementsByTagName("a");
				for (var i = 0; i < allA.length; i++) {
					allA[i].onclick=function(){
						var tr = this.parentNode.parentNode;
						var name = tr.children[0].innerHTML;
						var flag = confirm("确定删除"+name+"吗？")
						if (flag) {
							tr.parentNode.removeChild(tr);
						}
					}
					
				}
			}
			
            
        </script>
	</head>
	<body>
		<h2>工作经历</h2>
		<hr/>
		<div id="myContainer">
			<div class="myDiv" id="div1">
				公司名称:<input type="text" />
				职位:<input type="text" />
				<a href="javascript:RemoveRow('div1')">删除工作经历</a>
				<br />
				工作职责及工作内容描述:
				<textarea class="myArea"></textarea>
				<hr />
			</div>			
		</div>
		
		<div style="line-height: 30px; text-align: right;">
			<a href="javascript:AddRow();">添加工作经历</a>
		</div>

	</body>
</html>